Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use external distribution of Juliet test suite #155

Merged
merged 7 commits into from
Sep 14, 2023
Merged

Conversation

Lipen
Copy link
Collaborator

@Lipen Lipen commented Aug 28, 2023

This PR proposes to change the vendored Juliet test suite (pre-compiled JAR manually placed in resources folder) with an external distribution via JitPack.

@Lipen Lipen requested a review from volivan239 August 28, 2023 19:16
@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2023

jdk 11 test results

1 264 tests  +238   1 256 ✔️ +238   11m 47s ⏱️ -3s
     43 suites ±    0          8 💤 ±    0 
     43 files   ±    0          0 ±    0 

Results for commit e01e7b6. ± Comparison against base commit c0616ca.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2023

jdk 8 test results

1 260 tests  +234   1 249 ✔️ +234   11m 7s ⏱️ + 1m 0s
     43 suites ±    0        11 💤 ±    0 
     43 files   ±    0          0 ±    0 

Results for commit e01e7b6. ± Comparison against base commit c0616ca.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2023

jdk 19 test results

1 260 tests  +234   1 249 ✔️ +234   12m 17s ⏱️ +21s
     43 suites ±    0        11 💤 ±    0 
     43 files   ±    0          0 ±    0 

Results for commit e01e7b6. ± Comparison against base commit c0616ca.

♻️ This comment has been updated with latest results.

@Lipen
Copy link
Collaborator Author

Lipen commented Aug 28, 2023

As far as I can tell, all failing tests are CWE89, which are NOT present in juliet.jar (which was in the repo before the external Juliet suite was included), specifically, s03 and s04 folders.
@volivan239 maybe you can add some "bans" for them, too? Or write a separate analysis for them.

@volivan239
Copy link
Collaborator

As far as I can tell, all failing tests are CWE89, which are NOT present in juliet.jar (which was in the repo before the external Juliet suite was included), specifically, s03 and s04 folders. @volivan239 maybe you can add some "bans" for them, too? Or write a separate analysis for them.

The failing tests are due to defects in the analyzer for SQL injections, I'll create a separate issue for this. Indeed, I haven't tested analyzer on them previously (both for simplicity and saving CI time), let's just ban them for now.

@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Merging #155 (0ca6347) into develop (f6c3dfb) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             develop     #155   +/-   ##
==========================================
  Coverage      77.09%   77.09%           
  Complexity      1520     1520           
==========================================
  Files            157      157           
  Lines           8630     8630           
  Branches        1484     1484           
==========================================
  Hits            6653     6653           
  Misses          1413     1413           
  Partials         564      564           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -6,20 +6,26 @@ plugins {
kotlin("plugin.serialization") version "1.7.20"
}

repositories {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this to the root build.gradle.kts

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? Jitpack repo is only needed for this subproject.
Is it just to make it easier to keep track of external repos from one place (root build)?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good practice to declare global settings in global place. Even if this settings is used in one submodule.

testImplementation(files("src/test/resources/pointerbench.jar"))
testImplementation(group = "joda-time", name = "joda-time", version = "2.12.5")
testImplementation("com.github.Lipen.juliet-test-suite:support:1.3.6")
for (cweNum in listOf(89, 476, 563, 690)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to store such settings in gradle.properties

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, only these CWEs are supported by an existing analysis (afaik), so we only depend on them, but in the future the list will probably grow and might even be replaced with a whole suite.

Gradle properties are just Strings, aren't they? The simple listOf in dependencies {} seems to be cleaner than parsing [89, 476, 563, 690] string into a list of ints.

testImplementation(files("src/test/resources/pointerbench.jar"))
testImplementation(group = "joda-time", name = "joda-time", version = "2.12.5")
testImplementation("com.github.Lipen.juliet-test-suite:support:1.3.6")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a license problem with this dependency. Repo itself doesn't declare any license but have a reference that it is a copy of NIST lib which is under CC 1.0 into README.

I prefer to reference NIST Juliet itself (i.e remove any reference to find-sec-bugs repo) from your repo. Also it's better to host this repo inside UTBot organization.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ZIP archive from NIST does not contain the LICENSE file, either. Should I simply create one (CC0)?

Regarding the repo: I can re-upload the project under UTBot org, without "forking" (I bet I cannot simply "Transfer repo", since it would probably remain to be "forked"), but what about the git history? The initial commits were made by find-sec-bugs's members.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lipen Lipen requested a review from lehvolk September 1, 2023 13:23
@Lipen Lipen mentioned this pull request Sep 4, 2023
@lehvolk
Copy link
Collaborator

lehvolk commented Sep 12, 2023

@Lipen could you please resolve conflicts

@github-actions
Copy link
Contributor

Test results on JDK 8

1 271 tests  +234   1 260 ✔️ +234   8m 16s ⏱️ +47s
     45 suites ±    0        11 💤 ±    0 
     45 files   ±    0          0 ±    0 

Results for commit 0ca6347. ± Comparison against base commit f6c3dfb.

@github-actions
Copy link
Contributor

Test results on JDK 8

1 271 tests  +234   1 260 ✔️ +234   8m 17s ⏱️ +48s
     45 suites ±    0        11 💤 ±    0 
     45 files   ±    0          0 ±    0 

Results for commit 0ca6347. ± Comparison against base commit f6c3dfb.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 13, 2023

Test results on JDK 19

1 271 tests  +234   1 260 ✔️ +234   9m 41s ⏱️ +55s
     45 suites ±    0        11 💤 ±    0 
     45 files   ±    0          0 ±    0 

Results for commit 0ca6347. ± Comparison against base commit f6c3dfb.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 13, 2023

Test results on JDK 11

1 271 tests  +234   1 263 ✔️ +234   10m 32s ⏱️ -3s
     45 suites ±    0          8 💤 ±    0 
     45 files   ±    0          0 ±    0 

Results for commit 0ca6347. ± Comparison against base commit f6c3dfb.

♻️ This comment has been updated with latest results.

@lehvolk lehvolk merged commit f3a6516 into develop Sep 14, 2023
11 checks passed
@lehvolk lehvolk deleted the lipen/juliet branch September 14, 2023 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants